package com.kefu.exam.vo;

import org.apache.commons.lang3.StringUtils;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.kefu.common.context.KefuContext;
import com.kefu.common.vo.AbstractSearchVo;
import com.kefu.exam.model.ExamSubjectType;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author xy
 * @date 2022/02/28
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "考题分类表")
public class ExamSubjectTypeSearchVo extends AbstractSearchVo {

    @ApiModelProperty(value = "分类名")
    private String typeName;

	 @Override
    public  LambdaQueryWrapper<ExamSubjectType> lambdaQuery(){
    	LambdaQueryWrapper<ExamSubjectType> wrapper=Wrappers.<ExamSubjectType>lambdaQuery();
	    wrapper.eq(StringUtils.isNotBlank(typeName), ExamSubjectType::getTypeName, typeName);//分类名
	    wrapper.eq(ExamSubjectType::getTenantId, KefuContext.getKefuContext().getTenantId());
    	return wrapper;
	}
}